<%--
 *  File:    VisitPlanTempetDetail.jsp
 *  @Author: tendyhu
 *  Date:    2009-9-28 ??06:15:08

 *  Copyright (C) 2000 - 2009 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>
<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java"%>
<%@ page import="java.util.*"%>
<%@ page import="org.apache.log4j.Category"%>


<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>

<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom"%>

<%
  //init param
   	String strModuleName = "SFE";
  	String privilegeCode = "H0254";
  	String contextPath = request.getContextPath();
%>


<%@ include file="/inc/PageDefault.inc"%>
<%@ include file="/inc/LocationDefault.inc"%>
<html>
<head>
<title><%=label.getLabelName("L_EditWeekVisitPlan")%></title>
<%
if("Y".equals(request.getParameter("isconfirm"))){%>

%>
<script>
	opener.refreshWindow();
</script>
<%return;
}%>
<%
int nYear=0;
int nMonth=0;
int nWeek=0;
if(request.getParameter("year")!=null)
{
	nYear=Integer.parseInt(request.getParameter("year"));
}
else if(session.getAttribute("year")!=null)
{
	nYear=((Integer)session.getAttribute("year")).intValue();
}
if(request.getParameter("monthofyear")!=null)
{
	nMonth=Integer.parseInt(request.getParameter("monthofyear"));
}
else if(session.getAttribute("monthofyear")!=null)
{
	nMonth=((Integer)session.getAttribute("monthofyear")).intValue();
}
if(request.getParameter("weekofmonth")!=null)
{
	nWeek=Integer.parseInt(request.getParameter("weekofmonth"));
}
else if(session.getAttribute("weekofmonth")!=null)
{
	nWeek=((Integer)session.getAttribute("weekofmonth")).intValue();
}
Date dWeekStart=null;
Date dWeekEnd=null;
String strWeekStart="";
String strWeekEnd="";
String strFullDateFormat=label.getLabelName("L_FullDateFormat");
int nStartDayWeekOfMonth=0;
Calendar cal=null;
if(nYear>0 && nMonth>0 && nWeek>0)
{
	cal=Calendar.getInstance();
	cal.clear();
	cal.set(Calendar.YEAR, nYear);
	cal.set(Calendar.MONTH, nMonth-1);
	cal.set(Calendar.WEEK_OF_MONTH, nWeek);
	cal.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);
	dWeekEnd=cal.getTime();
	
	cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
	dWeekStart=cal.getTime();
	nStartDayWeekOfMonth=cal.get(Calendar.WEEK_OF_MONTH);
	session.setAttribute("weekstartdate",new java.sql.Date(dWeekStart.getTime()));
	session.setAttribute("weekenddate",new java.sql.Date(dWeekEnd.getTime()));
	
	java.text.SimpleDateFormat sdf=new java.text.SimpleDateFormat(strFullDateFormat);
	strWeekEnd=sdf.format(dWeekEnd);
	strWeekStart=sdf.format(dWeekStart);
	
}
%>
<PageFlow:CheckPageFlow pageName="p_visitplaneditdetail" />
<%@ include file="/inc/InitEdit.inc"%>
<%
HashMap visitplaninfo=(HashMap)pageContext.getAttribute("visitplaninfo");
		if(visitplaninfo==null)
			visitplaninfo=new HashMap();
int nStatus=-1;
String strStatus="";
if(	visitplaninfo.get("status")!=null)
{
		nStatus=((Integer)	visitplaninfo.get("status")).intValue();
		strStatus=com.oval.util.OvalDictionaryEngine.getDictionaryValueName("Status",strLanguageCode,""+nStatus).getM_strValueName();
}
Vector vDetails=(Vector)pageContext.getAttribute("visitplandetails");	
		if(vDetails==null)
			vDetails=new Vector();
%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet"
	href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css"
	type="text/css">
<script language="JavaScript"
	src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/ScriptLib.js"></script>
<script>
function page_finish()
{
	opener.refreshWindow();
}
function page_needassist(num,seq)
{
	var myform = eval("document.cform"+num);
	var sneedassist=eval("myform.showneedassist"+seq);
	var needassist=eval("myform.needassist"+seq);
	if(sneedassist.checked)
		needassist.value="Y";
	else
		needassist.value="N";	
}
function refreshWindow()
{
	var strUrl="VisitPlanEditDetail.jsp?ishistory=<custom:write property="ishistory"/>&contactid=<custom:write property="contactid"/>&orgid=<custom:write property="orgid"/>";
		strUrl=strUrl+"&year=<custom:write property="year"/>&monthofyear=<custom:write property="monthofyear"/>&weekofmonth=<custom:write property="weekofmonth"/>";
		strUrl=strUrl+"&<%= OvalTools.randomURL() %>";
		location.href=strUrl;
}
function page_save(num)
{
	var myform = eval("document.cform"+num);
	if(Number(myform.numrows.value)<1)
	 return;
	for(i=0;i<Number(myform.numrows.value);i++)
	{
		var sstart=eval("myform.splanstarttime"+i);
		var send=eval("myform.splanendtime"+i);
		var tsstart=eval("myform.tsplanstarttime"+i);
		var tsend=eval("myform.tsplanendtime"+i);
		
		var dvisit=eval("myform.planvisitdate"+i);
		if(isEmpty(tsstart.value))
			{
				alert("<%=message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_VisitPlanStartTime"))%>");
				return;
			}
			if(isEmpty(tsend.value))
			{
				alert("<%=message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_VisitPlanEndTime"))%>");
				return;
			}
			if(!isTime(tsstart.value,"HH:mm"))
			{
				alert("<%=message.getMessageDesc("ILLEGAL_FORMAT",label.getLabelName("L_VisitPlanStartTime"))%>(HH:mm)");
				return;
			
			}
			if(!isTime(tsend.value,"HH:mm"))
			{
				alert("<%=message.getMessageDesc("ILLEGAL_FORMAT",label.getLabelName("L_VisitPlanEndTime"))%>(HH:mm)");
				return;
			
			}
		sstart.value=dvisit.value+" "+tsstart.value+":00";
		send.value=dvisit.value+" "+tsend.value+":00";
		
	}
		myform.actionname.value = "save";
 		myform.target="_self";
 		isRunning = true;
 		myform.submit();
}
function page_add(num)
{
	var myform = eval("document.cform"+num);
		
	var strUrl="VisitPlanAddPop.jsp?contactid=<custom:write property="contactid"/>&orgid=<custom:write property="orgid"/>";
		strUrl=strUrl+"&year=<custom:write property="year"/>&monthofyear=<custom:write property="monthofyear"/>&weekofmonth=<custom:write property="weekofmonth"/>&dayofweek="+num;
		strUrl=strUrl+"&visitplanid=<custom:write property="visitplanid" name="visitplaninfo"/>&weekstart=<custom:write property="weekstartdate"/>&weekend=<custom:write property="weekenddate" />";
		strUrl=strUrl+"&weekstartweekofmonth=<%=nStartDayWeekOfMonth%>&activitytype=1&<%= OvalTools.randomURL() %>";
    	
		 var status="height=500, width=800,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no";
    if(popwindow!=null)
      popwindow.close();
   popwindow=window.open(strUrl, "addwindow", status);
}
function page_addother(num)
{
	var myform = eval("document.cform"+num);
		
	var strUrl="VisitPlanAddOtherPop.jsp?contactid=<custom:write property="contactid"/>&orgid=<custom:write property="orgid"/>";
		strUrl=strUrl+"&year=<custom:write property="year"/>&monthofyear=<custom:write property="monthofyear"/>&weekofmonth=<custom:write property="weekofmonth"/>&dayofweek="+num;
		strUrl=strUrl+"&visitplanid=<custom:write property="visitplanid" name="visitplaninfo"/>&weekstart=<custom:write property="weekstartdate"/>&weekend=<custom:write property="weekenddate" />";
		strUrl=strUrl+"&weekstartweekofmonth=<%=nStartDayWeekOfMonth%>&<%= OvalTools.randomURL() %>";
    	
		 var status="height=100, width=450,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no";
    if(popwindow!=null)
      popwindow.close();
   popwindow=window.open(strUrl, "addwindow", status);
}
function page_delete(num)
{
	var myform = eval("document.cform"+num);
	var details=eval("document.cform"+num+".detailids");
	
	
	if(isNullChecked(details))
  {
    alert("<%= message.getMessageDesc("MUST_SELECT_ONE_RECORD_TO_DEL") %>");
    return;
  }
  var flag = confirm("<%= message.getMessageDesc("ARE_YOU_SURE_DEL") %>");
  if(!flag)
    return;
		myform.actionname.value = "delete";
 		myform.target="_self";
 		isRunning = true;
 		myform.submit();
}
function page_move(num)
{
	var myform = eval("document.cform"+num);
	if(Number(myform.numrows.value)<1)
	 return;
	var details=eval("document.cform"+num+".detailids");
	
	if(isNullChecked(details))
	  {
	    alert("<%= message.getMessageDesc("MUST_SELECT_ONE_RECORD_TO_MOVE") %>");
	    return;
	  } 
	  
	var ids ="";
	  var checkboxs = details;
	 // alert(checkboxs.length);
	  if(checkboxs!=null&&checkboxs.length>0)
	  {
	  	for (var i=0; i<checkboxs.length; i++)
	  	{
	  	   if(checkboxs[i].checked==true)
	  	   {
	  	   	if(ids=="")
	  	   	{
	  	   	ids=checkboxs[i].value;
	  	  
	  	   	}else{
	  	   	ids=ids+","+checkboxs[i].value;
	  	   
	  	   	}
	  	   }
	  	   
	  	}
	  }

	
	

	var strUrl="VisitPlanMoveFrm.jsp?contactid=<custom:write property="contactid"/>&ids="+ids;
		strUrl=strUrl+"&year=<custom:write property="year"/>&monthofyear=<custom:write property="monthofyear"/>&weekofmonth=<custom:write property="weekofmonth"/>&dayofweek="+num;
		strUrl=strUrl+"&<%= OvalTools.randomURL() %>";
		 var status="height=500, width=800,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no";
    if(popwindow!=null)
      popwindow.close();
   popwindow=window.open(strUrl, "movewindow", status);
}
function page_submitforapproval()
{
    if(Number(<%=JspHelper.filterNull( vDetails.size() )%>) <= 0)
    {
      alert("<%= message.getMessageDesc("NO_BODY_INFO",label.getLabelName("L_VisitActivity",false)) %>");
      return;
    }
    if ( ! confirm("<%= message.getMessageDesc("ARE_YOU_SURE_TO_SUBMIT_APPROVE") %>") )  return;
  	document.cformoptions.actionname.value = "submitforapproval";
  	document.cformoptions.target = "_self";
  	isRunning = true;
  	document.cformoptions.submit();
}

function page_action(action)
{
  if (action=="deny" || action == "agree")
  {
      document.cformoptions.pagename.value = "approvalnotesedit";


      if (action == "deny")
      {
        document.cformoptions.actionname.value = "approvedenied";
	    document.cformoptions.content0.value = "<%= label.getLabelName("L_Refuse",false)%>";
      }
      else if (action == "agree")
      {
        document.cformoptions.actionname.value = "approvepassed";
		document.cformoptions.content0.value = "<%= label.getLabelName("L_Agree",false)%>";
      }
      isRunning = true;
      document.cformoptions.content1.value = document.cformoptions.content0.value;
      document.cformoptions.content3.value = document.cformoptions.content2.value;
	  document.cformoptions.target="_self";
      document.cformoptions.submit();
      return;
  }
}

</script>
</head>

<body>


<TABLE cellSpacing=0 width="100%">
	<TR>

		<TD class=td-blue width="84%"><%=label.getLabelName("L_VisitPlanDate")%><%=label.getLabelName("L_Colon")%>
		<%=strWeekStart%>-<%=strWeekEnd%></TD>
		<TD class=td-blue width="16%" align="right"><%=label.getLabelName("L_Status")%><%=label.getLabelName("L_Colon")%>
		<%=strStatus%></TD>

	</tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0" border="1">
	<%
  	String[] weekLabelArrs=new String[]{"L_Sunday","L_Monday","L_Tuesday","L_Wednesday","L_Thursday","L_Friday","L_Saturday"};
		
		
		int numCurr=0;
		HashMap oneDetail=null;
		
  	for(int i=1;i<=8;i++){
  	java.text.SimpleDateFormat sdf=new java.text.SimpleDateFormat(strFullDateFormat);
  	if(i%2==1){
  	%>
	<tr valign="top">
		<%}%>
		<td width="50%">
		<%if(i==8){%>&nbsp;<%}else{%>
		<form name="cform<%=i%>" method="post"
			action="<%=contextPath%>/Dispatcher"><input type="hidden"
			name="pagename" value="p_visitplaneditdetail"> <input
			type="hidden" name="actionname"> <custom:hidden
			property="contactid" /> <custom:hidden property="orgid" /> <custom:hidden
			property="year" /> <custom:hidden property="monthofyear" /> <custom:hidden
			property="ishistory" /> <custom:hidden property="weekofmonth" /> <custom:hidden
			property="visitplanid" name="visitplaninfo" /> <custom:hidden
			property="weekstartdate" changedName="weekstart" /> <custom:hidden
			property="weekenddate" changedName="weekend" /> <input type="hidden"
			name="weekstartweekofmonth" value="<%=nStartDayWeekOfMonth%>" />
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr>
				<td>
				<table width="100%" cellspacing="0" cellpadding="0">
					<tr class="deepblue-left">
						<td><%=label.getLabelName(weekLabelArrs[i-1])%>(<%=sdf.format(cal.getTime())%>)</td>
						<td class="td_right">
						<%
							if( visitplaninfo==null || visitplaninfo.isEmpty() || (visitplaninfo!=null&&((Integer)visitplaninfo.get("status").intValue()==10))) {
								%> <a onClick="page_add('<%=i%>')"><custom:button type="2"
							label="L_Add" imgsrc="back.gif" border="0" style="width:60" /></a> <a
							onClick="page_addother('<%=i%>')"><custom:button type="2"
							label="L_AddOther" imgsrc="back.gif" border="0" style="width:60" /></a>

						<a onClick="page_delete('<%=i%>')"><custom:button type="2"
							label="L_Delete" imgsrc="back.gif" border="0" style="width:60" /></a>
						<a onClick="page_save('<%=i%>')"><custom:button type="2"
							label="L_Save" imgsrc="back.gif" border="0" style="width:60" /></a> <a
							onClick="page_move('<%=i%>')"><custom:button type="2"
							label="L_Move" imgsrc="back.gif" border="0" style="width:60" /></a> <%}%>
						</td>
					</tr>
				</table>
				</td>
			</tr>
			<tr>
				<td>
				<table border="1" cellspacing="0" bordercolorlight="#999999"
					bordercolordark="#FFFFFF" cellpadding="0" width="100%">
					<tr class="deepblue-left">
						<td class="title_center" width="22">&nbsp;</td>
						<td class="title_center" width="120"><%=label.getLabelName("L_PlanActivityTypeInfo")%></td>
						<!--td class="title_center"   ><%=label.getLabelName("L_CustomerName")%></td>
          		<td class="title_center"  width="50" ><%=label.getLabelName("L_OrgPCName")%></td-->
						<td class="title_center" width="50"><%=label.getLabelName("L_ProcessName")%></td>
						<td class="title_center" width="50"><%=label.getLabelName("L_VisitPlanStartTime")%></td>
						<td class="title_center" width="50"><%=label.getLabelName("L_VisitPlanEndTime")%></td>
						<td class="title_center" width="30"><%=label.getLabelName("L_NeedAssist")%></td>
					</tr>
					<%
          	int seq=0;
          	if(numCurr<vDetails.size())
          	{
	          	if(oneDetail==null)
	          	{
	          		oneDetail=(HashMap)vDetails.get(numCurr);
	          		
	          	}
	          	seq=0;
	          	while(true){
	          	
          		Date dPlanVisitDate=(Date)oneDetail.get("planvisitdate");
          		
          		Calendar calPlanVisitDate=Calendar.getInstance();
          		java.text.SimpleDateFormat sdf2Str=new java.text.SimpleDateFormat("yyyy-MM-dd");
          		String sPlanVisitDate= sdf2Str.format(dPlanVisitDate);
          		dPlanVisitDate=sdf2Str.parse(sPlanVisitDate);
          		calPlanVisitDate.clear();
          		calPlanVisitDate.setTime(dPlanVisitDate);
          		
          		if(calPlanVisitDate.compareTo(cal)==0)
          		{
          			pageContext.setAttribute("onevisitdetail",oneDetail);
          			java.text.SimpleDateFormat sdf2Time=new java.text.SimpleDateFormat("HH:mm");
          			Date dStart=(Date)oneDetail.get("planstarttime");
          			Date dEnd=(Date)oneDetail.get("planendtime");
          			String sStart="";
          			String sEdit="";
          			if(dStart!=null)
          				sStart=sdf2Time.format(dStart);
          			if(dEnd!=null)
          				sEdit=sdf2Time.format(dEnd);
          			String sAssistChecked	="";
          			if("Y".equals(oneDetail.get("needassist")))
          				sAssistChecked="checked";
          			String strStyleClass="none";
          			if(seq%2==1)
          				strStyleClass="td-listrom";
          				String checkDisabled="";
          				boolean selectDisabled=false;
          			if(oneDetail.get("mainvisitplandetailid")!=null)
          			{
          				checkDisabled="disabled";
          				selectDisabled=true;
          			}
          					
          		Integer oSeq=new Integer(seq);			
          	%>
					<tr onMouseOver="this.className='tr-over'"
						onMouseOut="this.className='none'" onClick=""
						class="<%=strStyleClass%>">
						<td height="22"><input type="checkbox"
							id="detailids_<%=i%>_<%=seq%>" <%=checkDisabled%>
							name="detailids"
							value="<custom:write name="onevisitdetail" property="visitplandetailid" />"
							class="normalradio"> <custom:hidden name="onevisitdetail"
							property="visitplandetailid" colIndex="<%=oSeq%>" /> <custom:hidden
							name="onevisitdetail" property="planvisitdate"
							colIndex="<%=oSeq%>" /> <input type="hidden"
							name="splanstarttime<%=seq%>" /> <input type="hidden"
							name="splanendtime<%=seq%>" /> <custom:hidden
							name="onevisitdetail" property="needassist" colIndex="<%=oSeq%>" />
						</td>
						<td>
						<%pageContext.setAttribute("displayflag","view");%> <custom:selectdic
							name="onevisitdetail" property="activitytype"
							dictType="PlanActivityType" /> <%
							Integer activityType=(Integer)oneDetail.get("activitytype");
							String disabledByActivityType="";
							boolean isDisabledByActivityType=false;
							if(activityType.intValue()==1){
							%> ( <a onclick=""><custom:write name="onevisitdetail"
							property="customercode" nbsp="true" /></a> &nbsp; <custom:write
							name="onevisitdetail" property="customershortname" nbsp="true" />
						&nbsp; <custom:selectdic name="onevisitdetail"
							property="globalpccode" dictType="GlobalPCCode" /> ) <%}else{
								disabledByActivityType="disabled";
								isDisabledByActivityType=true;
								selectDisabled=true;
								%> <%}
							pageContext.setAttribute("displayflag","");
							%>
						</td>
						<!--td><a onclick=""><custom:write name="onevisitdetail" property="customercode" nbsp="true"/></a></td>
							<td><custom:write name="onevisitdetail" property="customershortname" nbsp="true" /></td>
							<td><custom:write name="onevisitdetail" property="globalpcname" nbsp="true"/></td-->

						<td><custom:select name="onevisitdetail" property="processid"
							disabled="<%=selectDisabled%>" optionsName="allprocesses"
							optionValueKey="visitprocessid" optionInnerTextKey="processname"
							colIndex="<%=oSeq%>" defaultValue="---" defaultValueCost=" " /></td>
						<td><input type="text" size="6"
							name="tsplanstarttime<%=seq%>" <%=checkDisabled%>
							value="<%=sStart%>" /></td>
						<td><input type="text" size="6" name="tsplanendtime<%=seq%>"
							<%=checkDisabled%> value="<%=sEdit%>" /></td>
						<td><input type="checkbox" <%=disabledByActivityType%>
							name="showneedassist<%=seq%>" <%=checkDisabled%> value="Y"
							<%=sAssistChecked%> class="normalradio"
							onclick="javascript:page_needassist('<%=i%>','<%=seq%>')"></td>

					</tr>

					<%
			seq++;
					numCurr++;
          if(numCurr<vDetails.size())
          {
          	oneDetail=(HashMap)vDetails.get(numCurr);
          }
        else
        	break;
			}
		else{
			break;
			}
			}
			}%>
				</table>
				<input type="hidden" name="numrows" value="<%=seq%>" /></td>
			</tr>
		</table>
		</form>
		<%
			cal.add(Calendar.DATE,1);
			}%>
		</td>
		<%if(i%2==0){%>
	</tr>
	<%}
	 }%>
</table>
<table width="100%" cellspacing="0" cellpadding="0">
	<form name="cformoptions" method="post"
		action="<%=contextPath%>/Dispatcher">
	<tr>
		<td class="summary_top"><input type="hidden" name="pagename"
			value="p_visitplaneditdetail"> <input type="hidden"
			name="actionname"> <%
  String strLanguageCode0;
  String strLanguageCode1;
  if(strLanguageCode.equalsIgnoreCase("cn"))
  {
	strLanguageCode0 = "cn";
	strLanguageCode1 = "en";
  }else{
	strLanguageCode0 = "en";
	strLanguageCode1 = "cn";
  }
%> <input type="hidden" name="languagecode0"
			value="<%= strLanguageCode0 %>"> <input type="hidden"
			name="languagecode1" value="<%= strLanguageCode1 %>"> <input
			type="hidden" name="languagecode2" value="<%= strLanguageCode0 %>">
		<input type="hidden" name="languagecode3"
			value="<%= strLanguageCode1 %>"> <input type="hidden"
			name="entitytype0" value="NT"> <input type="hidden"
			name="entitytype1" value="NT"> <input type="hidden"
			name="entitytype2" value="NC"> <input type="hidden"
			name="entitytype3" value="NC"> <input type="hidden"
			name="numrows" value="4"> <input type="hidden"
			name="content0"> <input type="hidden" name="content1">
		<input type="hidden" name="content2"> <input type="hidden"
			name="content3"> <custom:hidden property="visitplanid"
			name="visitplaninfo" changedName="transactionid" /> <input
			type="hidden" name="subjectcode" value="2VPW"> <custom:hidden
			property="orgid" /> <custom:hidden property="weekplancode"
			name="visitplaninfo" changedName="transactioncode" /> <custom:hidden
			property="visitplanid" name="visitplaninfo" changedName="slipid" /> <custom:hidden
			name="userinfo" property="userid" scope="session"
			changedName="fromuserid" /> <input type="hidden" name="begindate"
			value="<%=JspHelper.filterNull( new java.sql.Date(new java.util.Date().getTime()) )%>">
		<custom:hidden property="contactid" /> <custom:hidden property="year" />
		<custom:hidden property="monthofyear" /> <custom:hidden
			property="ishistory" /> <custom:hidden property="weekofmonth" /> <custom:hidden
			property="visitplanid" name="visitplaninfo" /> <custom:hidden
			property="weekstartdate" changedName="weekstart" /> <custom:hidden
			property="weekenddate" changedName="weekend" /> <input type="hidden"
			name="weekstartweekofmonth" value="<%=nStartDayWeekOfMonth%>" /></td>
	</tr>
	<tr>
		<td class="td_center"><a onClick="javascript:page_finish()"><custom:button
			type="1" label="L_Finish" imgsrc="back.gif" border="0"
			style="width:60" /></a> <%if(visitplaninfo!=null ){
			if(nStatus==10){%> <a onclick="page_submitforapproval()"><custom:button
			type="1" label="L_Submit_batch" imgsrc="submit_batch.gif" border="0"
			style="width:60" /></a> <%}else if(nStatus==20){%> <a
			onclick="page_approve()"><custom:button type="1"
			label="L_Approve" imgsrc="approve.gif" border="0" style="width:60" /></a>
		<a onclick="page_action('agree')"><custom:button type="1"
			label="L_Agree" imgsrc="Agree.gif" border="0" style="width:60" /></a> <a
			onclick="page_action('deny')"><custom:button type="1"
			label="L_Deny" imgsrc="no_agree.gif" border="0" style="width:60" /></a> <%}else if(nStatus==29){%>
		<a onclick="page_remodify()"><custom:button type="1"
			label="L_ReModify" imgsrc="no_agree.gif" border="0" style="width:60" /></a>

		<%}else if(nStatus==40){%> <a onclick="page_closeplan()"><custom:button
			type="1" label="L_CloseVistPlan" imgsrc="no_agree.gif" border="0"
			style="width:60" /></a> <%}%> <%}%>
		</td>
	</tr>
	</form>
</table>

</body>

</html>